-
Notifications
You must be signed in to change notification settings - Fork 45
POC: start adding "repro snippets" for failed assertions #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
One more example:
|
|
The shape of this POC is getting clear now. I've converted one of the test modules, Converting the rest is a bit of mechanical work, but is totally doable. Downsides:
|
I found myself wishing for this feature again today. The added DevEx far outweighs the obscured git blame, in my opinion. Is there anything blocking this? |
It is not always easy to tell what exactly failed with hypothesis (data-apisgh-379). Thus add a failing snippet to the exceptions' output. For instance, run $ ARRAY_API_TESTS_MODULE=array_api_compat.torch pytest array_api_tests/test_array_object.py::test_getitem to see E ValueError: step must be greater than zero E E ========== FAILING CODE SNIPPET: E tensor([False, False])[(slice(1, 0, -1),)] E ====================
Thanks for the ping @cbourjau !
I suppose the only thing blocking this is some elbow grease, would you be able to help? Would be great to split the set of test files, #384 (comment) --- the changes are pretty mechanical, just need to be test by test source file by source file. The solution to the git blame issue is to add a Therefore,
|
Coincidentally, I was looking at the |
It is not always easy to tell what exactly failed with hypothesis (gh-379). Thus add a failing snippet to the exceptions' output.
With this PR, the OP example from gh-379 preserves whatever output pytest and hypothesis generated, and adds an explicit incantation that triggered the error:
The approach here is a bit manual, and I don't see a generic way to make it less so.